﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="RelatorioJogos.aspx.cs" Inherits="SFsoftSite.Relatorios.RelatorioJogos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1 style="padding-left:30px">
        Relatório de Jogos mais Aderidos
    </h1>
    <br />
    <table style="border:2px solid #a1a1a1; border-radius:15px;" align="center">
        <tr>
            <td>
                <asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1" 
                    Height="600px" Width="800px">
                <Series>
                    <asp:Series Name="Jogos mais Aderidos" XValueMember="Nome" YValueMembers="Quantidade" 
                        IsValueShownAsLabel="True" Legend="Legend1">
                    </asp:Series>
                </Series>
                <ChartAreas>
                    <asp:ChartArea Name="ChartArea1">
                        <AxisY Title="Quantidade de Jogos" TitleFont="Arial, 14.25pt, style=Bold">
                        </AxisY>
                        <AxisX Title="Nome do Jogo" TitleFont="Arial, 14.25pt, style=Bold">
                        </AxisX>
                    </asp:ChartArea>
                </ChartAreas>
                    <Legends>
                        <asp:Legend Name="Legend1">
                        </asp:Legend>
                    </Legends>
                </asp:Chart>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\SFGameStoreBD.mdf;Integrated Security=True;User Instance=True" 
                
                    
                    SelectCommand="SELECT Jogos.Nome, COUNT(ClienteJogo.Jogo) AS Quantidade FROM Jogos INNER JOIN ClienteJogo ON Jogos.ID = ClienteJogo.Jogo GROUP BY Jogos.Nome ORDER BY Quantidade  DESC">
                </asp:SqlDataSource>
            </td>
        </tr>
    </table>
    <br />
    <br />
</asp:Content>
